<?php

$page->title = 'Portfolio';

?>

<div>

    <h1><?= $page->title ?></h1>

    <nav class="tag-nav">
        <ul class="l-inline">
            <?php foreach($page->tags as $tag): ?>
            <li><a href="<?= url('portfolio/tag/' . $tag) ?>"><?= $tag ?></a></li>
            <?php endforeach ?>
        </ul>
    </nav>


    <ul class="block-grid three-up album">
        <?php foreach( $page->projects as $key => $project ) : ?>
        <li>
            <figure>
                <a href="portfolio/<?= $project->getId() ?>">
                    <img src="<?= $project->getThumb() ?>">
                </a>
                <figcaption>
                    <?php if($project->hasTitle()): ?>
                    <p><?php echo $project->getTitle() ?></p>
                    <?php endif ?>
                    <?php if( isset( $project->tags )): ?>
                    <p class="footnote"><?php echo implode(', ',$project->tags) ?></p>
                    <?php endif ?>
                </figcaption>
            </figure>
        </li>
        <?php endforeach ?>
    </ul>

</div>
